﻿using Dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZhouYu.DreamTour.Core;
using ZhouYu.DreamTour.DAL.IRepository;
using ZhouYu.DreamTour.Model;

namespace ZhouYu.DreamTour.DAL.Repository
{
    public class RouteRepository:IRouteRepository
    {
        #region 根据条件获取具体酒店信息
        /// <summary>
        /// 根据条件获取具体酒店信息
        /// </summary>
        /// <returns></returns>
        public Hotel GetHotelByID(int HotelId)
        {
            string sql = @"SELECT `HotelId`,`HotelName`,`Level`,`Hotel_Tel`,`TotelType`,`EndPlace`,`Describe`,`Hotel_CreateTime`,`Hotel_UpdateTime` FROM Hotel where HotelId=@HotelId";
            DynamicParameters dynamicParameters = new DynamicParameters();
            dynamicParameters.Add("@HotelId", HotelId);
            return DapperHelper<Hotel>.QuerySingleOrDefault(sql, dynamicParameters);
        } 
        #endregion
    }
}
